from pathlib import Path
import json

name = input("What's your name?")
path = Path('10_chapter_10_test\\username.json')
contents = json.dumps(name)
path.write_text(contents)
print(f"OK. We will remeber you when you come back {name}")